<template>
  <div>
    <component
      :is="isComponent"
      :fileList="fileList"
      :show-upload-list="false"
      action="https://jsonplaceholder.typicode.com/posts/"
    >
      <div v-if="dragger">拖拽</div>
      <div v-else>上传</div>
    </component>
  </div>
</template>

<script>
/**
 *Parser
 *@Author
 *@Version
 *@property
 *@event
 */
import { Upload } from 'ant-design-vue'
const { Dragger } = Upload
export default {
  props: {
    dragger: {
      type: Boolean,
      default: false
    },
    limit: {
      type: [Number, String],
      default: ''
    },
    size: {
      type: [Number, String],
      default: ''
    },
    defaultFileList: {
      type: Array,
      default: () => {}
    },
    accept: {
      type: String,
      default: ''
    }
  },
  computed: {
    isComponent () {
        return this.dragger ? Dragger : Upload
    }
  },
  data () {
    return {
      fileList: []
    }
  },
  methods: {}
}
</script>
<style scoped>
</style>
